import req from '@/utils/request'
import * as url from '../constants/api'

// 获取评论
export function getComments(params) {
    return req({
        url: url.COMMENTS,
        method: 'GET',
        params
    })
}

// 对评论点赞
export function commentLike(target) {
    return req({
        url: url.COMMENTLIKE,
        method: 'POST',
        data: {
            target
        }
    })
}
// 取消对评论点赞
export function noCommentLike(target) {
    return req({
        url: url.NOCOMMENTLIKE + target,
        method: 'DELETE',
    })
}

// 发表评论
export function pubComment(params) {
    return req({
        url: url.COMMENTS,
        method: 'POST',
        data: params
    })
}